from socket import *

# 创建tcp套接字
s = socket()
s.bind(('0.0.0.0', 8000))
s.listen(3)

c, addr = s.accept()
print('Connect from', addr)
data = c.recv(4096)
print(data)

# http响应
data = """HTTP/1.1 200 OK
Content-Type:text/html

<h1>Hello</h1>


"""
c.send(data.encode())

c.close()
s.close()
